Background Art
In various computer systems, historical log data is maintained (for example, in log files) for use in system recovery, problem determination and/or system maintenance. Typically, these log files have a limited amount of capacity to retain the historical data. After the capacity is met, at least some of the data records are moved from the log files to external storage devices, such as direct access storage devices (DASD), thereby providing additional space in the log file for more data.
At some point, data within the log file and/or on the external storage devices are no longer needed. For example, there is no need to keep the data once it passes its retention requirements. The saving of data past its usefulness adversely affects system performance in a number of ways. For example, when unnecessary data is retained and the log file needs to be browsed to recover logged data during recovery of a failure, the browser may have to deal with potentially large amounts of unnecessary data, thereby slowing down the recovery process. Additionally, when the saving of unwanted data records requires the use of external storage devices, which typically provide slower access to the data, the reading of the data takes longer, thus, affecting system performance.
Therefore, it is beneficial to delete any unnecessary data from the log files. However, generally, there are a number of restrictions placed on what data can be deleted. In one example, data may only be deleted from the tail of the log file. Thus, if the data record at the tail is still necessary, then no data can be deleted from the log file. This forces the saving of many unnecessary or unwanted data records.
The above problem is exacerbated when a log file is shared by multiple systems and the data record at the tail is owned by a system that has failed. In that case, the data record may not be deleted for a very long time, if at all, causing the saving of an increasing number of unwanted data records.
Thus, a need exists for a technique that allows the removal of unnecessary data records from a log file, even when the data record at the tail is still wanted. A further need exists for a technique that allows the removal of data records by the non-owner of the data records. A yet further need exists for a log management capability that can compress a log file in an efficient manner.
The shortcomings of the prior art re overcome and additional advantages are provided through the provision of a system of managing a log stream. The system includes, for example, means for identifying an entry of the log stream that is not Eligible for removal from the log stream; and a processor adapted to logically delete the entry from the log stream. The logical deletion keeps the entry on the log stream and indicates that the entry can be removed from the log stream when it is eligible to be removed.
In one example, the system includes; a scratch pad adapted to indicate the logical deletion of the entry. The scratch pad is separate from the log stream.
In a further example, the processor is also adapted to remove the entry from the log stream when the entry is eligible for removal. In one embodiment, the processor includes a resource manager not owning the entry, and the resource manager is adapted to initiate the removal of the entry from the log stream.
In another aspect of the present invention, a system of managing a log stream is provided, which includes means for logically deleting one entry from the log stream when the entry is ineligible for removal from the log stream; means for removing another entry from the log stream, in which the removing causes the one entry to be eligible for removal; and means for removing the one entry from the log stream, subsequent to removal of the another entry.
In yet a further aspect of the present invention, a system of managing a log stream is provided which includes a resource manager adapted to initiate a rewrite of a first entry from one location of the log stream to another location of the log stream, when the first entry is to at least temporarily remain on the log stream. The resource manager is further adapted to initiate deletion of the first entry from the one location.
The log management capability of the present invention advantageously provides for the logical deletion of unnecessary log entries on a log stream, such that the logically deleted entries can subsequently be removed from the log stream by any resource manager connected to the log stream. The technique of the present invention allows the removal of unnecessary data records from the log stream, even when the entry at the tail is still wanted. The invention advantageously provides for the rewriting of the entry at the tail to another location within the log stream, so that unnecessary entries can be deleted. Additionally, the log management capability of the present invention enables the efficient compression of the log stream, in which additional log streams are not necessary.
Additional features and advantages are realized through the techniques of the present invention. Other embodiments and aspects of the invention are described in detail herein and are considered a part of the claimed invention.